$def with (form, name, output, svg, errors, log)
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<!-- header info used to contain extra information about
   this document, not displayed on the page -->
<!-- skinning here
-->
<style type="text/css">
	body {background:url(http://matthiasvegh.dyndns.org/bg.png);}

	.upper div {margin-bottom: 10px; }
	.upper p {padding: 0; margin: 0; }
	.upper {display: inline-block;}
	svg {border: 1px solid black;background:white;}
	.MathJax span {clip: auto!important;}
	textarea#input {width: 100%;}
	td { display: block; padding: 0;}
	form, table {width: 100%; border-collapse: collapse;}
	th { display: block; }
	.log {border: 1px dashed darkgrey; border-radius: 5px; display: inline-block; min-width:30%; padding: 5px}
	.output { background: rgba(111, 190, 107, 0.1); border-width: 1px 0px 1px 0px; border-style: solid; border-color:rgba(111, 190, 107, 0.7);
			display:block; font-size:20px; width:auto!important; padding: 10px;
	}
	.input { background: rgba(126, 152, 190, 0.1); border-width: 1px 0px 1px 0px; border-style: solid; border-color:rgba(126, 152, 190, 0.7);
			display:block; font-size:20px; width:auto!important; padding: 10px;
	}
	.errors { background: rgba(190, 74, 51, 0.1); border-width: 1px 0px 1px 0px; border-style: solid; border-color:rgba(190, 74, 51, 0.7);
			display:block; font-size:20px; width:auto!important; padding: 10px; 
	}

</style>

 <script type="text/x-mathjax-config">
MathJax.Hub.Config({
	"HTML-CSS": 	{ linebreaks: { automatic: true, width: "30em" } },
  		"SVG": 		{ linebreaks: { automatic: true, width: "80% Container" } },
		"NativeMML":{ linebreaks: { automatic: true, width: "80% Container" } },
		tex2jax: {inlineMath: [['$$','$$'], ['\\(','\\)']]}

	});

</script>
<script type="text/javascript">
	   function escapeCharacters(){
		arr = location.href.split(/\#/);
		res = arr[0];
		for(i = 1; i<arr.length; ++i){
			res += escape('#') + arr[i];
		}
		if(res != location.href && arr.length > 1){
			window.location = res; 
		}
	}
</script>
<script type="text/javascript"
	src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_SVG.js">
</script>

<link rel="icon" type="image/png" href="http://www.gstatic.com/codesite/ph/images/defaultlogo.png" />
<title>Tungsten|Alpha</title>
</head>
<body onload = "escapeCharacters()">
	<div align="center">
		<div class="upper">
		$if name:
			<p>Your Input:</p><div class="input"> 
				<script type="math/tex; mode=display">
				\begin{align}
					$name
				\end{align}
				</script>
			</div>
		$else:
			<p>Try me!</p>
		$if errors:
			<p>Errors:</p><div class="errors">$:errors</div>
		$if output:
			<p>Output:</p><div class="output">
				<script type="math/tex; mode=display">
					$output
				</script>
			</div>
		$if svg and not output:
			</div>
			<div class="svg">$:svg</div>
			<div class="upper">
		<form name="main" method="post">
			$:form.render()
			<input type="submit" />
		</form>
		</div>
		<br>
		<a href="http://code.google.com/p/tungsten">Source code on Google Code</a>
		<br>
		$if name:
			<p>Last 10 inputs:</p>
			<div class="log">$:log</div>
		$else:
			Try these inputs:<br>
			<a href="/tungsten/2+2">2+2</a><br>
			<a href="/tungsten/5!">5!</a><br>
			<a href="/tungsten/Graphics[Circle[]]">Graphics[Circle[]]</a><br>
			<a href="/tungsten/Plot[Sin[x], {x, -5, 5, 0.1}]">Plot[Sin[x], {x, -5, 5, 0.1}]</a><br>
			<a href="/tungsten/Graphics[Table[BezierCurve[{{RandomReal[], RandomReal[]}, {RandomReal[], RandomReal[]}, {RandomReal[], RandomReal[]}, {RandomReal[], RandomReal[]}}], {10}]]">Graphics[Table[BezierCurve[{{RandomReal[], RandomReal[]}, {RandomReal[], RandomReal[]}, {RandomReal[], RandomReal[]}, {RandomReal[], RandomReal[]}}]]]</a><br>
	</div> 
</body>
</html>



